﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Nix.PBeM.Engine.DataTypes
{
	public class LearningBonus
	{
		public LearningBonus ()
		{
		}

		private Dictionary<string, int> learningBonus = new Dictionary<string, int>();

		public int this[Skill skill]
		{
			get
			{
				if ( learningBonus.ContainsKey(skill.Tag) )
				{
					return learningBonus[skill.Tag];
				}
				return 0;
			}
			set
			{
				if ( value <= 0 && learningBonus.ContainsKey(skill.Tag) )
				{
					learningBonus.Remove(skill.Tag);
				}
				if ( value > 0 )
				{
					learningBonus[skill.Tag] = value;
				}
			}
		}
	}
}
